/**
* \brief Implementation of 'Visitor' design pattern.
*	 Header file with auxiliary classes.
* \author Bartosz Kedra (bartosz.kedra@gmail.com)
*/

class Visitor;
class ElementA;
class ElementB;
class ElementC;

class Element
{
public:
	virtual void accept(Visitor& v) = 0;
};

class Visitor
{
public:
	virtual void visit(ElementA& a) = 0;
	virtual void visit(ElementB& b) = 0;
	virtual void visit(ElementC& c) = 0;
};

class ElementA : public Element
{
public:
	virtual void accept(Visitor& v)
	{
		v.visit(*this);
	}
};

class ElementB : public Element
{
public:
	virtual void accept(Visitor& v)
	{
		v.visit(*this);
	}
};

class ElementC : public Element
{
public:
	virtual void accept(Visitor& v)
	{
		v.visit(*this);
	}
};
